#include <stdio.h>
#include <math.h>
int main()
{
    long int a, b, c;
    printf("please enter a OPTIONAL FRACTION(a/b):");
    scanf("%ld/%ld", &a, &b);
    printf(" it can be decomposed to:");
    while (1)
    {
        if (b % a)
            c = b / a + 1;
        else
        {
            c = b / a;
            a = 1;
        }
        if (a == 1)
        {
            printf("1/%ld", c);
            break;
        }
        else
            printf("1/%ld+", c);
        a = a * c - b;
        b = b * c;
        if (a == 3)
        {
            printf("1/%ld+1/%ld\n", b / 2, b);
            break;
        }
    }
}